package com.lyc.shopping_mall.service.iml;

import com.lyc.shopping_mall.dto.ProductWithCategoryName;
import com.lyc.shopping_mall.mapper.ProductMapper;
import com.lyc.shopping_mall.pojo.Product;
import com.lyc.shopping_mall.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceiml implements ProductService {


    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Product> getAllProduct() {
        return productMapper.getAllProduct();
    }

    @Override
    public List<Product> getAdProduct() {
        return productMapper.getAdProduct();
    }

    @Override
    public List<ProductWithCategoryName> getProductByCategory(String name) {
        return productMapper.getProductByCategory(name);
    }
}
